import random as r
from individual import *
import attributes as at
r.seed(2011)

class population():
    def __init__(self,inN,inyear):
        self.head=at.head
        self.year=inyear
        self.pool=[]
        self.n=inN
        
        for i in range (self.n):
            pid=i
            age=r.randint(10,20)
            sex=at.sex[r.randint(0,len(at.sex)-1)]
            job=at.job[r.randint(0,len(at.job)-1)]
            geo=at.geo[r.randint(0,len(at.geo)-1)]
            person=individual(pid,age,sex,job,geo)
            self.pool.append(person)
        
    
    def remove(self,item):
        self.pool.remove(item)
    def __getitem__(self,index):
        return self.pool[index]
    def __len__(self):
        return int(len(self.pool))